package in.muton.edushare.panels.upload.postProcessors;

import in.muton.edushare.imageProcessor.ImageProcessor;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.edushare.common.file.IFileProcessStrategy;
import com.edushare.common.vo.FileUploadInfo;
import com.edushare.common.vo.interfaces.IProcessor;

public class PostProcessingFactory {
	
	private static Log log = LogFactory.getLog(PostProcessingFactory.class);
	private PostProcessingFactory(){}
	
	public static IProcessor getProcessor(IFileProcessStrategy fileProcessStrategy, FileUploadInfo fuvo){
		
		if(fileProcessStrategy==null)
			return null;
		
		int fileType = fileProcessStrategy.fileType();
		log.debug(fileType+"=="+IFileProcessStrategy.FILE_TYPE_IMAGE);
		if(fileType == IFileProcessStrategy.FILE_TYPE_IMAGE){
			return new ImageProcessor(fileProcessStrategy, fuvo);
		}
		else
		{
			return null;
		}
	}
	
}
